#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

bool isPrime(int n)
{
	if (n == 2) return true;

	int i = 2;
	for (; i*i <= n; ++i)
		if (n % i == 0)
		{
			break;
		}

	if (i*i > n)
		return true;

	return false;
}

int main()
{
	int n;
	cin >> n;

	int a = 4;
	while (a < n)
	{
		int b = n - a;
		if (!isPrime(b))
		{
			cout << a << " " << b << endl;
			break;
		}

		a += 2;
	}

	return 0;
}
